﻿using PHMEE.DTOS.StatusMonitor;
using PHMEE.ToolKits;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE
{
    public class PhMEEChartModel : PhMEEChartModel<string, float?>
    {
        public PhMEEChartModel()
        {

        }
        public PhMEEChartModel(PhmeeEchartUnit xUnit) : base(xUnit)
        {

        }
        public PhMEEChartModel(PhmeeEchartUnit xUnit, PhmeeEchartUnit yUnit) : base(xUnit, yUnit)
        {

        }
    }
    public class PhMEEChartModel<Tx, TY>
    {
        public PhMEEChartModel()
        {

        }
        public PhMEEChartModel(PhmeeEchartUnit xUnit)
        {
            this.XDataUnit = PHMEECoreHelper.PhmeeGetDescription(xUnit);
        }
        public PhMEEChartModel(PhmeeEchartUnit xUnit, PhmeeEchartUnit yUnit)
        {
            this.XDataUnit = PHMEECoreHelper.PhmeeGetDescription(xUnit);
            this.YDataUnit = PHMEECoreHelper.PhmeeGetDescription(yUnit);
        }
        /// <summary>
        ///  Echart X轴数据单位
        /// </summary>
        public string XDataUnit { get; set; }
        /// <summary>
        /// Echart X轴数据项  一般对应XAxis
        /// </summary>
        public List<Tx> XData { get; set; } = new List<Tx>();
        /// <summary>
        /// Echart Y轴数据单位
        /// </summary>
        public string YDataUnit { get; set; }
        /// <summary>
        /// Echart Y轴数据项  一般对应Series
        /// </summary>
        public List<TY> YData { get; set; } = new List<TY>();
        /// <summary>
        /// Echart 图标类型  line折线图、bar柱状图
        /// </summary>
        public string Type { get; set; } = "line";

        /// <summary>
        /// 报警信息
        /// </summary>
        public string Info { get; set; }

        /// <summary>
        /// 阈值集合
        /// </summary>
        public ChartThreshold Properties { get; set; }
    }

    public enum PhmeeEchartUnit
    {
        [Description("")]
        NONE = 0,

        [Description("ms")]
        MS = 1,

        [Description("Hz")]
        HZ = 2,

        [Description("mm/s")]
        MMS = 3,

        [Description("g")]
        G = 4

    }
}
